//
//  RootViewController.m
//  SweetComics
//
//  Created by LeeZhe on 15/1/28.
//  Copyright (c) 2015年 LeeZhe. All rights reserved.
//

#import "RootViewController.h"
#import "UserViewController.h"
#import "TakeViewController.h"
#import "ClassifyViewController.h"
#import "HomePageViewController.h"
#import "ReCommendViewController.h"
@interface RootViewController ()
- (void)createViewController;
@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self createViewController];
}
- (void)createViewController
{
    // 首页
    
    HomePageViewController *homeVC = [[[HomePageViewController alloc] init] autorelease];
    
    UINavigationController *homeNC = [[[UINavigationController alloc] initWithRootViewController:homeVC] autorelease];
    
    homeNC.tabBarItem.title = @"首页";
    homeNC.tabBarItem.image = [UIImage imageNamed:@"iconfont-shouye.png"];
    
    
    // 推荐
    
    ReCommendViewController *recommendVC = [[[ReCommendViewController alloc] init] autorelease];
    
    UINavigationController *recommendNC = [[[UINavigationController alloc] initWithRootViewController:recommendVC] autorelease] ;
    recommendNC.tabBarItem.title = @"推荐";
    recommendNC.tabBarItem.image = [UIImage imageNamed:@"iconfont-tuijian.png"];
    
    
    
    // 用户
    UserViewController *userVC = [[[UserViewController alloc] init] autorelease];
    UINavigationController *userNC = [[[UINavigationController alloc] initWithRootViewController:userVC] autorelease];
    userNC.tabBarItem.title = @"用户";
    userNC.tabBarItem.image = [UIImage imageNamed:@"iconfont-yonghu.png"];
    
    // 订阅
    TakeViewController  *takeVC = [[[TakeViewController alloc] init] autorelease];
    UINavigationController *takeNC = [[[UINavigationController alloc] initWithRootViewController:takeVC] autorelease];
    takeNC.tabBarItem.title = @"订阅";
    takeNC.tabBarItem.image = [UIImage imageNamed:@"iconfont-shoucangyuankongxin.png"];
    
    
    //  分类
    ClassifyViewController *classVC = [[[ClassifyViewController alloc] init] autorelease];
    
    UINavigationController *classNC = [[[UINavigationController alloc] initWithRootViewController:classVC] autorelease];
    
    classNC.tabBarItem.title = @"分类";
    classNC.tabBarItem.image  = [UIImage imageNamed:@"iconfont-dibudaohangfenlei2.png"];
    self.viewControllers = @[homeNC,recommendNC,takeNC,classNC,userNC];
    self.tabBar.backgroundColor = [UIColor orangeColor];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
